package com.xdap.keymen.controller.punch;

import com.xdap.keymen.service.punch.PunchContactPersonService;
import com.xdap.motor.annotation.RestWrapper;
import com.xdap.motor.vo.ResponseVo;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/custom/punch/contact")
@RequiredArgsConstructor
@Slf4j
public class PunchContactPersonController {
    private final PunchContactPersonService punchContactPersonService;

    @GetMapping("/list")
    @RestWrapper
    public ResponseVo getContactPersonList(String rv) {
        return punchContactPersonService.getContactPersonList(rv);
    }

    @GetMapping("/detail")
    @RestWrapper
    public ResponseVo getContactPersonDetail(String custnum,String tabDocId) {
        return punchContactPersonService.getCustshiptoinvaddrPerson(custnum,tabDocId);
    }

    @GetMapping("/detailShipTo")
    @RestWrapper
    public ResponseVo getContactPersonDetailShipTo(String custnum,String tabDocId) {
        return punchContactPersonService.getCustShiptoPerson(custnum,tabDocId);
    }
}
